package com.geekgo.distributedlock.redissonlock;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author geekgo
 * @version 2017/2/9 18:32
 */
@Configuration
public class DistributedLockConfig {


    @Bean("distributedLockTemplate")
    public DistributedLockFactoryBean getDistributeLockTemplate()throws Exception{
        DistributedLockFactoryBean distributedLockFactoryBean = new DistributedLockFactoryBean();
        distributedLockFactoryBean.setMode("SINGLE");
        return distributedLockFactoryBean;
    }
}
